﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ScriptEditor.Commands
{
    class Command_CenterText : Command
    {
        public string content
        {
            get
            {
                return Text;
            }
            set
            {
                Text = value;
            }
        }
        public bool newPage
        {
            get
            {
                return bool.TryParse(Value1, out bool result) ? result : true;
            }
            set
            {
                Value1 = value.ToString();
            }
        }
        public float quitTime
        {
            get
            {
                return float.TryParse(Value2, out float result) ? result : 0;
            }
            set
            {
                Value2 = value.ToString();
            }
        }
        public bool rollMode
        {
            get
            {
                return bool.TryParse(Value3, out bool result) ? result : false;
            }
            set
            {
                Value3 = value.ToString();
            }
        }
        public float showTime
        {
            get
            {
                return float.TryParse(Value4, out float result) ? result : 0.5f;
            }
            set
            {
                Value4 = value.ToString();
            }
        }
        public bool addHistory
        {
            get
            {
                return bool.TryParse(Value5, out bool result) ? result : false;
            }
            set
            {
                Value5 = value.ToString();
            }
        }
        public string voiceName
        {
            get
            {
                return Value6;
            }
            set
            {
                Value6 = value;
            }
        }public string contetJp
        {
            get
            {
                return Value7;
            }
            set
            {
                Value7 = value;
            }
        }
        public string contetTc
        {
            get
            {
                return Value8;
            }
            set
            {
                Value8 = value;
            }
        }
        public Command_CenterText()
        {
            CommandType = COMMANDTYPE.CenterText;
            content = "请输入内容";
            newPage = true;
            quitTime = -1f;
            rollMode = false;
            showTime = 0.5f;
            addHistory = false;
            voiceName = "";
            contetJp = "";
            contetTc = "";
            Wait = true;
        }
        public Command_CenterText(string Content, bool NewPage, float QuitTime, bool RollMode, float ShowTime, bool AddHistory = true, string VoiceName = "", string ContetJp = "", string ContentTc = "")
        {
            CommandType = COMMANDTYPE.CenterText;
            content = Content;
            newPage = NewPage;
            quitTime = QuitTime;
            rollMode = RollMode;
            showTime = ShowTime;
            addHistory = AddHistory;
            voiceName = VoiceName;
            contetJp = ContetJp;
            contetTc = contetTc;
            Wait = true;
        }
        public override string ToString()
        {
            return CommandType.ToString() + ":\n" + "显示中间文本:" + content;
        }
    }
}
